import type { BasicColumn, FormSchema } from '/@/components/Table'
import { render } from '/@/utils/common/renderUtils';
import * as selfFunc from './ltrt.func'


export const searchFormSchema: FormSchema[] = [
    {
    label: '单行文本',
    field: 'textInput',
    colProps: {
    span:8
    },
    component:'Input',
    },
    {
    label: '数字输入框',
    field: 'numberInput',
    colProps: {
    span:8
    },
    component:'Input',
        slot: 'numberInput',
    },
    {
    label: '多行文本框',
    field: 'textarea',
    colProps: {
    span:8
    },
    component:'Input',
    },
    {
    label: '字典下拉',
    field: 'dictSelect',
    colProps: {
    span:8
    },
    component:'JDictSelectTag',
        componentProps: {
            dictCode: 'position_rank',
            stringToNumber: true,
        },
    },
    {
    label: '字典表下拉搜索框',
    field: 'dictSelectSearch',
    colProps: {
    span:8
    },
    component:'JSearchSelect',
        componentProps: {
        dict: 'quartz_status',
        },
    },
    {
    label: '字典单选',
    field: 'dictRadio',
    colProps: {
    span:8
    },
    component:'JDictSelectTag',
        componentProps: {
        type:'radio',
        dictCode: 'bonus_way',
        stringToNumber: true,
        },
    },
    {
    label: '开关',
    field: 'dictSwitch',
    colProps: {
    span:8
    },
    component:'JDictSelectTag',
        componentProps: {
            dictCode: 'is_open',
            stringToNumber: true,
        },
    },
    {
    label: '年月日',
    field: 'dateYmd',
    colProps: {
    span:8
    },
    component:'RangePicker',
        componentProps: {
        valueType: 'Date',
        }
    },
    {
    label: '月份',
    field: 'dateYmdhms',
    colProps: {
    span:8
    },
    component:'RangePicker',
        componentProps: {
        valueType: 'Date',
        }
    },
    {
    label: '时分秒',
    field: 'dateHms',
    colProps: {
    span:8
    },
    component:'RangePicker',
        componentProps: {
        valueType: 'Date',
        }
    },
    {
    label: '下拉树',
    field: 'selectTree',
    colProps: {
    span:8
    },
    component:'Input',
    },
]

export const columns: BasicColumn[] = [
    {
    title: '单行文本',
        dataIndex: 'textInput',
        align:'center',
    },
    {
    title: '数字输入框',
        dataIndex: 'numberInput',
        align:'center',
    },
    {
    title: '可变文本框',
        dataIndex: 'dynamicInput',
        align:'center',
    },
    {
    title: '字典下拉',
        dataIndex: 'dictSelectTxt',
        align:'center',
    },
    {
    title: '字典表下拉搜索框',
        dataIndex: 'dictSelectSearchTxt',
        align:'center',
    },
    {
    title: '下拉多选',
        dataIndex: 'selectMultiTxt',
        align:'center',
    },
    {
    title: '字典单选',
        dataIndex: 'dictRadioTxt',
        align:'center',
    },
    {
    title: '字典复选框',
        dataIndex: 'dictCheckBoxTxt',
        align:'center',
    },
    {
    title: '开关',
        dataIndex: 'dictSwitchTxt',
        align:'center',
        customRender: selfFunc.renderDictSwitch,
    },
    {
    title: '年月日',
        dataIndex: 'dateYmd',
        align:'center',
    },
    {
    title: '月份',
        dataIndex: 'dateYmdhms',
        align:'center',
    },
    {
    title: '时分秒',
        dataIndex: 'dateHms',
        align:'center',
    },
    {
    title: '上传文件',
        dataIndex: 'uploadFile',
        align:'center',
    },
    {
    title: '上传图片',
        dataIndex: 'uploadImg',
        align:'center',
        customRender: render.renderImg,
    },
    {
    title: '选择部门',
        dataIndex: 'selectDeptDialog',
        align:'center',
    },
    {
    title: '选择用户',
        dataIndex: 'selectUserDialog',
        align:'center',
    },
    {
    title: '选择角色',
        dataIndex: 'selectRoleDialog',
        align:'center',
    },
    {
    title: '省市区级联',
        dataIndex: 'pca1',
        align:'center',
    },
    {
    title: '省市区联动',
        dataIndex: 'pca2',
        align:'center',
    },
    {
    title: '下拉树',
        dataIndex: 'selectTreeTxt',
        align:'center',
    },
    {
    title: '创建时间',
        dataIndex: 'createTime',
        align:'center',
    },
    {
    title: '更新时间',
        dataIndex: 'updateTime',
        align:'center',
    },
]

export const formSchema: FormSchema[] = [
    {
    label: '编号',
    field: 'id',
    show: false,
    component: 'Input',
    },
    {
    label: '树表',
        field: 'treeId',
colProps: {
    span:12,
},
    component: 'JDictSelectTag',
        componentProps: {
            type:'select',
            dictCode:'gene_tree,title,id',
                stringToNumber:true,
        },
    },
    {
    label: '单行文本',
        field: 'textInput',
colProps: {
    span:12,
},
    component: 'Input',
    },
    {
    label: '数字输入框',
        field: 'numberInput',
colProps: {
    span:12,
},
    component: 'InputNumber',
    },
    {
    label: '密码',
        field: 'pswordInput',
colProps: {
    span:12,
},
    component: 'InputPassword',
    },
    {
    label: '多行文本框',
        field: 'textarea',
colProps: {
    span:12,
},
    component: 'InputTextArea',
    },
    {
    label: '可变文本框',
        field: 'dynamicInput',
colProps: {
    span:12,
},
    component: 'Input',
    },
    {
    label: '字典下拉',
        field: 'dictSelect',
colProps: {
    span:12,
},
    component: 'JDictSelectTag',
        componentProps: {
            type:'select',
            dictCode:'position_rank',
        },
    },
    {
    label: '字典表下拉搜索框',
        field: 'dictSelectSearch',
colProps: {
    span:12,
},
    component: 'JSearchSelect',
        componentProps: {
            dict:'quartz_status',
        },
    },
    {
    label: '下拉多选',
        field: 'selectMulti',
colProps: {
    span:12,
},
    component: 'JSelectMultiple',
        componentProps: {
            dictCode:'bank_code',
        },
    },
    {
    label: '字典单选',
        field: 'dictRadio',
colProps: {
    span:12,
},
    component: 'JDictSelectTag',
        componentProps: {
            type:'radio',
            dictCode:'bonus_way',
        },
    },
    {
    label: '字典复选框',
        field: 'dictCheckBox',
colProps: {
    span:12,
},
    component: 'JCheckbox',
        componentProps: {
            dictCode:'activiti_sync',
        },
    },
    {
    label: '开关',
        field: 'dictSwitch',
colProps: {
    span:12,
},
    component: 'JSwitch',
    },
    {
    label: '年月日',
        field: 'dateYmd',
colProps: {
    span:12,
},
    component: 'DatePicker',
    },
    {
    label: '月份',
        field: 'dateYmdhms',
colProps: {
    span:12,
},
    component: 'MonthPicker',
    },
    {
    label: '时分秒',
        field: 'dateHms',
colProps: {
    span:12,
},
    component: 'DatePicker',
        componentProps: {
        valueFormat: 'YYYY-MM-DD hh:mm',
        },
    },
    {
    label: '上传文件',
        field: 'uploadFile',
colProps: {
    span:12,
},
    component: 'JUpload',
        componentProps: {
                        bizPath: 'demo/ltrt',
        },
    },
    {
    label: '上传图片',
        field: 'uploadImg',
colProps: {
    span:12,
},
    component: 'JImageUpload',
        componentProps: {
                        bizPath: 'demo/ltrt',
                        fileType: 'image',
        },
    },
    {
    label: '选择部门',
        field: 'selectDeptDialog',
colProps: {
    span:12,
},
    component: 'JSelectDept',
    },
    {
    label: '选择用户',
        field: 'selectUserDialog',
colProps: {
    span:12,
},
    component: 'JSelectUserByDept',
    },
    {
    label: '选择角色',
        field: 'selectRoleDialog',
colProps: {
    span:12,
},
    component: 'JSelectRole',
    },
    {
    label: '省市区级联',
        field: 'pca1',
colProps: {
    span:12,
},
    component: 'JAreaSelect',
    },
    {
    label: '省市区联动',
        field: 'pca2',
colProps: {
    span:12,
},
    component: 'JAreaLinkage',
    },
    {
    label: '下拉树',
        field: 'selectTree',
colProps: {
    span:12,
},
    component: 'JTreeSelect',
            componentProps: {
            dict:'org_category',
                    hasChildField: 'is_leaf',
                    pidValue: '0',
                    pidField: 'parent_id',
                    converIsLeafVal: 0,
            },
    },
    {
    label: '富文本',
        field: 'textEditor',
colProps: {
    span:24,
},
    component: 'JEditor',
    },
    {
    label: '代码编辑器',
        field: 'codeEditor',
colProps: {
    span:24,
},
    component: 'JCodeEditor',
    },
]



